import React, { Component } from 'react';
import { Switch, Route } from 'react-router-dom';

class RouteView extends Component {
    render() {
        return (
            <Switch>
                {
                    this.props.routes.map((res, index) => {
                        return <Route key={index} path={res.path} exact={res.exact || false} component={res.component}></Route>;
                    })
                }
            </Switch>
        );
    }

    UNSAFE_componentWillMount = () => {

    }

    componentDidMount = () => {

    }
}

export default RouteView;